<%--
  Created by IntelliJ IDEA.
  User: sz
  Date: 2018/8/8
  Time: 19:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm-extend.min.js' charset='utf-8'></script>
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
    <div id="redioArea">
        <input type="radio"  name="Arearedio" value="男" checked="checked"/> 男
        <input type="radio"  name="Arearedio" value="女" /> 女
    </div>
    <input id="test" value="ssss"/>
    <div id="BoxArea">
        <select id="selectArea">

        </select>
    </div>
<script>
    $(function () {
      //  alert("ss");
        //var s1 = $('#redioArea input[name="Arearedio"]:eq(0)');
        //alert(s1.val());
        //selectAreaFunction();
       // alert($("#redioArea input[name=Arearedio]:checked").val())
        selectRedio();
    })
    function selectRedio() {
        $.each($('#redioArea input[name="Arearedio"]'),function (index,item) {
           alert( $('#redioArea input[name="Arearedio"]:eq('+index+')').val());
           alert(item.val());
            alert(index);
        })
    }
    function  selectAreaFunction() {
        var html='';
        $.ajax({
            url:"getOption",
            type:"GET",
            success:function (data) {
               $.each(data.result,function (index,item) {
                   if(item.name=="第二个"){
                      html+='<option id='+'"'+item.id+'"'+' '
                          +'selected='+'"selected"'
                          +' class='+'"FirstName"'
                          +'>'
                          +item.name
                          +'</option>';
                   }else{
                       html+='<option id="'+item.id+'">'
                           +item.name
                           +"</option>";
                   }
               });
                $("#selectArea").html(html);
            }
        });

    }
</script>
</body>
</html>
